package model

import (
	"newRetailByGolang/variable"
	"time"
)

type RegistrationActivitie struct {
	Id int64
	Name string
	LevelId int
	TypeId int64     //  0 :直属   1 :团队
	TypeName string
	RegistrationStartTime time.Time
	RegistrationEndTime time.Time
	StartTime time.Time
	EndTime time.Time
	Status int
	CreatedAt time.Time
	UpdatedAt time.Time
}

func (registrationActivitie *RegistrationActivitie) QueryActivitieAll(page int) []*RegistrationActivitie{
	var registrationActivitieList []*RegistrationActivitie
	variable.Db.Limit(1).Offset(page * 1).Find(&registrationActivitieList)
	return registrationActivitieList
}

func (registrationActivitie *RegistrationActivitie) QueryActivitieAllTotal() int64{
	var count int64
	variable.Db.Table("registration_activities").Count(&count)
	return count
}